package com.acme;

import com.acme.bankapp.service.bank.*;
import com.acme.bankapp.domain.bank.*;
import com.acme.bankapp.domain.bank.Client.Gender;

public class BankApplication {

	private static void modifyBank(double amount, Bank bank, int clientCount) {
		Client[] client = bank.getClients();
		for (int i = 0; i < clientCount; i++) {
			Account addmoney = client[i].getAccount();
			addmoney.deposit(amount);
		}

	}

	private static void printBalance(Bank bank, int clientCount) {
		Client[] client = bank.getClients();
		for (int i = 0; i < clientCount; i++) {
			Account addmoney = client[i].getAccount();
			client[i].getClientSolutation();
			System.out.print(" balance: ");
			addmoney.getBalance();
		}
	}

	public static void main(String[] args) {

		final int clientCount = 5; // initial number of clients in bank
		Bank bank = new Bank();

		for (int j = 0; j < clientCount; j++) {
			bank.clients[j] = new Client("Client " + j, Gender.MALE,
					new SavingAccount(100.5 + j));
		}

		modifyBank(10, bank, clientCount);
		BankService BS = new BankService();
		// add some clients:
		BS.addClient(bank, 5, "Julia", Gender.FEMALE, 1050.2);
		BS.addClient(bank, 6, "Nadia", Gender.FEMALE, 1000, 12000);
		BS.addClient(bank, 7, "Nick", Gender.MALE, 3000, 5000);
		bank.clients[5].getAccount().deposit(1223);
		bank.clients[6].getAccount().withdraw(5000);

		BS.printMaximumAmountToWithdraw(bank, clientCount + 3);

	}

}